#ifndef _FRAME_BUF_MAN_H_
#define _FRAME_BUF_MAN_H_
#include "fifo_lhn_frame.h"

class CFamebuf_arr
{
public:
	CFamebuf_arr();
	~CFamebuf_arr();
	int Init(int ch_nums);
	int UnInit();
	int Open(int ch, int buf_sz,int frame_size);
	int Read_Frame(int ch , unsigned char * buf, int buf_sz,int clientID);
	int Write_Frame(int ch , unsigned char * buf, int data_size,int frmType);
	int GetWater(int ch ,int clientID);
	int SeekTime(int ch ,int64_t startTime,int prepareSecs);
	int Refresh(int ch,int clientID);
	CLHNFrame * GetFrameFIFO(int ch)
	{
		if(ch >= (int)m_vecfifo.size())
		{
			return NULL;
		}

		return &m_vecfifo[ch];
	}

	int GetFIFONum()
	{
		return (int)m_vecfifo.size();
	}
protected:
	vector<CLHNFrame> m_vecfifo;

};
extern CFamebuf_arr     g_frame_arr;
#endif
